package com.jbit.controller;

import com.github.pagehelper.PageInfo;
import com.jbit.pojo.HotEvents;
import com.jbit.service.HotEventsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("/hot")
@RestController
public class HotEventsController {
    @Resource
    private HotEventsService hotEventsService;

    @GetMapping("/list")
    public PageInfo<HotEvents> list(String keyword, @RequestParam(defaultValue = "1") Integer pageNum){
        return hotEventsService.getAllByKeyWord(keyword,pageNum);
    }
}
